<%--
  Created by IntelliJ IDEA.
  User: 16484
  Date: 2020/3/30
  Time: 15:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@  taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>Title</title>
    <!-- 引入css样式文件 -->
    <!-- Bootstrap Core CSS -->
    <link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet" />
    <!-- MetisMenu CSS -->
    <link href="<%=basePath%>css/metisMenu.min.css" rel="stylesheet" />
    <!-- DataTables CSS -->
    <link href="<%=basePath%>css/dataTables.bootstrap.css" rel="stylesheet" />
    <!-- Custom CSS -->
    <link href="<%=basePath%>css/sb-admin-2.css" rel="stylesheet" />
    <!-- Custom Fonts -->
    <link href="<%=basePath%>css/font-awesome.min.css" rel="stylesheet"
          type="text/css" />
    <link href="<%=basePath%>css/boot-crm.css" rel="stylesheet"
          type="text/css" />
</head>
</head>
<body>
<div class="container">
    <!--  标题  按钮 数据  分页 -->
    <div class="row " class="col-md-12">
        <h1>学生信息展示</h1>
    </div>

    <!-- 		主体头标签展示 -->
    <div class="row">
        <div class="col-md-offset-9  col-md-3">
            <button class="btn  btn-primary">添加</button>
            <button class="btn  btn-danger">批量删除</button>
        </div>
    </div>

    <!--分页展示学生数据 -->
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">用户信息列表</div>
                <!-- /.panel-heading -->
                <table class="table table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>用户ID</th>
                        <th>姓名</th>
                        <th>密码</th>
                        <th>权限</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${pageInfo.list}" var="row">
                        <tr>
                            <td align="center">${row.userid}</td>
                            <td align="center">${row.username}</td>
                            <td align="center">${row.password}</td>
                            <td align="center"><fmt:formatDate value="${row.creatime}" pattern="yyyy-MM-dd"/></td>
                            <td align="center">${row.perms}</td>
                            <td align="center"><a href="#"
                                                  class="btn btn-primary btn-xs" data-toggle="modal"
                                                  data-target="#customerEditDialog"
                            >修改</a> <a href="#"
                                       class="btn btn-danger btn-xs"
                            >删除</a></td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-md-6">当前第${pageInfo.pageNum}页/共${pageInfo.pages}页每页${pageInfo.pageSize} 总共${pageInfo.total}数据</div>
                    <div class="col-md-6">
                        <nav aria-label="Page navigation">
                            <ul class="pagination">
                                <li><a href="<%=basePath%>/stuList.action?pn=1">首页</a></li>
                                <c:if test="${pageInfo.hasPreviousPage}">

                                    <li><a href="#" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span></a></li>
                                </c:if>
                                <c:forEach items="${ pageInfo.navigatepageNums}" var="pageNum">
                                    <c:if test="${pageNum==pageInfo.pageNum}">
                                        <li class="active">
                                            <a href="<%=basePath%>/stuList.action?pn=${pageNum }">${pageNum }</a>
                                        </li>
                                    </c:if>
                                    <c:if test="${pageNum!=pageInfo.pageNum}">
                                        <li class="  ">
                                            <a href="<%=basePath%>/stuList.action?pn=${pageNum }">${pageNum }</a>
                                        </li>
                                    </c:if>
                                </c:forEach>
                                <!--    <li><a href="#">1</a></li>
                                  <li><a href="#">2</a></li>
                                  <li><a href="#">3</a></li>
                                  <li><a href="#">4</a></li>
                                  <li><a href="#">5</a></li>    -->

                                <c:if test="${pageInfo.hasNextPage }">
                                    <li><a href="<%=basePath%>/stuList.action?pn=${pageInfo.pageNum+1 }" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span></a></li>
                                </c:if>
                                <li><a href="<%=basePath%>/stuList.action?pn=${pageInfo.pages }">末页</a></li>
                            </ul>
                        </nav>






                    </div>

                </div>

            </div>


        </div>

</body>
</html>
